﻿@using QDT.Core
@using QDT.Core.Projects
@using QDT.MVC
@using QDT.MVC.UI
@model QDT.Common.IPagedList<QDT.Core.Projects.Project>
@{
    ViewBag.Title = "担保公司";
    int i = 1;
    bool isLogin = QDTContext.Current.IsAuthenticated;
}
  
 <script src="@Url.Content("~/Content/Default/JS/RegistAndLogin/tinybox.js")" type="text/javascript"></script>
<style>
    .contract-img{width: 180px;height: 110px;height: 115px;margin-left: 25px;margin-top: 15px;}
    .divcss5_list_title{background:#eeeeee; border:1px solid #cccccc; padding:1em;}
    .divcss5_list_content{padding:1em;}
    #tinybox{position:absolute; display:none; padding:10px; background:#ffffff url(/Content/Default/Images/Trait/preload.gif) no-repeat 50% 50%; border:10px solid #e3e3e3; z-index:2000;}
    #tinymask{position:absolute; display:none; top:0; left:0; height:100%; width:100%; background:#000000; z-index:1500;}
    #tinycontent{background:#ffffff; font-size:1.1em;}

    #n{margin:10px auto; width:920px; border:1px solid #CCC;font-size:12px; line-height:30px;}
    #n a{ padding:0 4px; color:#333}
    .ui-tab-items li a.active{color: #d52d18;border-bottom: 2px solid #d52d18;}
</style>
<div class="">
    <div>
        <div style="background-color: #f8f8f8; border-bottom: 1px solid #E5E5E5;">
            <ul class="ui-tab-items" style="height: 68px; line-height: 68px; margin: 0 auto; width: 980px;">
                <li style="float: left; font-size: 18px; margin: 0 30px;"><a href="javascript:;" class="active">黔商市西</a> </li>
                <li style="float: left; font-size: 18px; margin: 0 30px;"><a href="@Url.Action("FL")">黔投担保</a> </li>
@*                <li style="float: left; font-size: 18px; margin: 0 30px;"><a href="@Url.Action("ZYCT")">遵义城投</a> </li>*@
@*                <li style="float: left; font-size: 18px; margin: 0 30px;"><a href="@Url.Action("JDH")">金顶汇</a> </li>*@
            </ul>
        </div>
        <div style="background: url(/Content/Default/Images/Agencybanner01.png) center no-repeat; height: 436px; overflow: hidden; position: relative; width: 100%;">
            <div style="margin: 0 auto; width: 980px;color: #fff;line-height: 30PX; ">
                <div style=" margin-top: 35px; padding: 0 20px;height: 250px;">
                    <div>
                        <p style="background: url(/Content/Default/Images/dsx.png) no-repeat;margin-bottom: 10px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            &nbsp;&nbsp;&nbsp;&nbsp;<span style="font-size: 18PX; ">贵州黔商市西投资担保股份有限公司</span>
                        </p>
                    </div>
                    <p style="font-size: 14px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;贵州省黔投担保股份有限公司是从事贷款担保等各种担保业务以及投融资业务和理财企业财务顾问等相关咨询服务于一体的综合性非准金融机构。公司是建立在贵州省企业投融资促进会这个为贵州省招商引资服务、为贵州企业特别是为中小企业投、融资服务的社团平台之上的一家股份制民营企业。公司于2009年3月30日在贵州省工商行政管理局注册登记，注册资本人民币一亿元，是为中小企业投融资平台服务的较大的担保公司。</p>
                </div>
                <div style="padding: 0 20px;margin-top: 10px;width: 295px;float: left;">
                    <p class="" style="font-size: 18PX;margin-bottom: 10px;">项目概况</p>
                    <div style="text-align: center;">
                        <div style="width: 120px;float: left;border-right: 1px solid #ccc;"><p><span style="font-size: 24px;">0</span><span>万</span></p>
                        <p><span style="font-size: 16px;">累计融资</span></p>
                        </div>
                      
                        <p><span style="font-size: 16px;">还款完成</span>&nbsp;&nbsp;<span style="font-size: 20px;color: #ffa024;">0</span><span>万</span></p>
                        <p><span style="font-size: 16px;">还款中</span>&nbsp;&nbsp;<span style="font-size: 20px;color: #ffa024;">0</span><span>万</span></p>
                    </div>
                  
                </div>
                <div style="margin-top: ">
                      <a href="javascript:" id="DSXdetail01"><img src="/Content/Default/Images/Others/qssx01.jpg" class="contract-img" /></a>
                    <a href="javascript:" id="DSXdetail02"><img src="/Content/Default/Images/Others/qssx02.jpg" class="contract-img" /></a>
                    <a href="javascript:" id="DSXdetail03"><img src="/Content/Default/Images/Others/qssx03.jpg" class="contract-img" /></a>
                </div>
            </div>
        </div>
    </div>
    <div style="background: #f8f8f8">
        <div class="ui-inner">
            <div>
                <p style="font-size: 18px; padding: 40px 0 0 40px;">相关项目</p>
                 <span style="vertical-align: middle; line-height: 40px; font-size: 14px; color: #999;padding-left: 40px;">
                2014年5月20日&nbsp;&nbsp;开始合作</span>
            </div>
            <div style="height: auto; width: 1002px;padding-bottom: 40px;" class=" fn-clear">
                 @foreach (Project project in Model)
                 {
                     var agency = Html.F().GetAgency(project.Parent.AgencyId);
                <div style="float: left; margin-right: 22px;margin-top: 30px;">
                    <div style="box-shadow: 1px 1px 1px 1px #e5e5e5; border-radius: 6px 6px 6px 6px;
                        background-color: #ffffff; height: 486px;">
                        <div class="project_item1">
                            <h2> 
                                @if (isLogin && QDTContext.Current.User.GroupID == 1)
                                {
                                    <a href="@Url.Action("Project", "Offline", new { id = project.ID })" class="font-size20">@project.Name</a>
                                }
                                else
                                {
                                    <a href="@Url.Action("Index", "Project", new { id = project.ID })"  class="font-size20">@project.Name</a>
                                }
                            </h2>
                            <div style="height: 30px; margin: 10px 0 22px;">
                                <div style="float: left;">
                                    <img style="width: 25px; height: 25px;" src="@(agency == null ? Url.Content("~/Content/Default/Images/ziyaicon.jpg") : agency.Logo)" /></div>
                                <a href="javascript:;" style="line-height: 25px;">
                                    &nbsp;&nbsp; 
                                    <span style="line-height: 25px;" class="font-size14">@(agency == null ? "资产抵押" : agency.SubName)</span>
                                </a>
                                &nbsp;｜&nbsp;
                                <span class="font-size14" style="line-height: 25px;">付息还本</span>
                            </div>
                            <div style="height: 22px;">
                                <h3>
                                    <span class="font-size16">@(string.IsNullOrWhiteSpace(project.Parent.IndustryDetail) ? "" : project.Parent.IndustryDetail)</span>
                                </h3>
                            </div>
                            <div style="height: 118px;">
                            <p style="margin: 10px auto 17px; color: #aaa; line-height: 1.5;" class="font-size14">
                                @(project.Parent.Description.Length > 80 ? project.Parent.Description.Substring(0, 80) : project.Parent.Description)...
                            </p>
                            </div>
                            <p style="border-bottom: 1px dashed #ccc;">
                            </p>
                            <div style="width: 100%; margin-top: 21px; height: 22px;" class="progress_bar">
                                <div style="width: 100%; height: 10px; border-radius: 4px; background-color: #f1f1f1;box-shadow: inset 0 1px 2px #ccc;">
                                    <strong class="progress_bgdimg" id="@("progress_" + i)" style="width: @(project.Progress.ToString("0.0") + '%'); background:url(/Content/Default/Images/prograss_bar.png) repeat-x; display: block;  border-radius: 4px;height: 100%;text-align: center;">
                                    </strong>
                                </div>
                                <div style="margin-top: 12px;">
                                    <span class="font-size14">@project.LoadMoney.ToMoney()</span>/<span class="font-size14"><em
                                        class="time-item">@project.BorrowAmount.ToMoney("F", 10000.00)</em><em class="time-item">万</em></span>
                                </div>
                            </div>
                            <div style="height: 80px; margin-top: 37px;">
                                <div style="float: left; width: 135px;">
                                    <span style="display: block; margin: 0 15px;"><em style="font-size: 35px; color: #ffa024;
                                        line-height: 35px;">@project.Rate</em><em class="font-size16" style="color: #ffa024;">.00%</em></span>
                                    <span class="font-size16">预期年化收益率</span>
                                </div>
                                <div style="float: right; padding-left: 40px; width: 90px; border-left: 1px solid #e5e5e5">
                                    <span style="display: block; margin: 0 5px;"><em style="font-size: 35px; line-height: 35px;">@project.RepayTime</em><em
                                        class="font-size16">个月</em></span> <span class="font-size16">借款期限</span>
                                </div>
                            </div>
                        </div>
                        @switch (project.Status)
                        {
                            case ProjectStatus.Full:
                            <a href="javascript:;" style="" class="ui-button ui-button-disable project_item1_is font-size16">
                                已满 </a>
                
                                break;
                            case ProjectStatus.Repaying:
                            <a href="@Url.Action("Index", "Project", new { id = project.ID })" style="" class="ui-button ui-button-progect-gray project_item1_is font-size16">
                                还款中 </a>
                                break;
                            case ProjectStatus.Repaid:
                            <a href="@Url.Action("Index", "Project", new { id = project.ID })" style="" class="ui-button ui-button-progect-gray project_item1_is font-size16">
                                已还完 </a>
                
                                break;
                            case ProjectStatus.Progress:
                            <a href="@Url.Action("Index", "Project", new { id = project.ID })" class="ui-button font-size16 @(project.StartTime.Value > DateTime.Now ? "ui-button-red" : "ui-button-orange") project_item1_is">
                                @(project.StartTime.Value > DateTime.Now ? @project.StartTime.Value.ToString("HH:mm") + ' ' + "开售" : "投资")
                            </a>
                            break;
                            case ProjectStatus.Bad:
                            <a href="javascript:;" style="" class="ui-button ui-button-green project_item1_is project_item1_is font-size16">
                                流标 </a>
                            break;
                            case ProjectStatus.Wait:
                            <a href="javascript:;" style="" class="ui-button ui-button-green project_item1_is font-size16">
                                等待 </a>
                            break;
                        }
                    </div>
                </div>
                <script type="text/javascript">
        $("#@("progress_" + i)").ready(function() {
           
            if (@project.Progress>=100)
             {
                $("#@("progress_" + i)").css("background","url(/Content/Default/Images/prograss_bar2.png) repeat-x");
            }
           
        });
                </script>
                i++;
            }
            </div>
           
        </div>
    </div>
</div>
<script type="text/javascript">
    var content1 = "<div style='width: 1020px;height: 740px;overflow: auto;'><img src='/Content/Default/Images/Others/qssx01.jpg' /></div>"; //弹出图片
    getElement('DSXdetail01').onclick = function () { TINY.box.show(content1, 0, 0, 0, 1) };
    var content2 = "<div style='width: 1020px;height: 740px;overflow: auto;'><img src='/Content/Default/Images/Others/qssx02.jpg' /></div>"; //弹出图片
    getElement('DSXdetail02').onclick = function () { TINY.box.show(content2, 0, 0, 0, 1) };
    var content3 = "<div style='width: 1020px;height: 740px;overflow: auto;'><img src='/Content/Default/Images/Others/qssx03.jpg' /></div>"; //弹出图片
    getElement('DSXdetail03').onclick = function () { TINY.box.show(content3, 0, 0, 0, 1) };

    $('.close_openbox').onclick= function() {
        TINY.box.hide();
    }
    $('.filter-item').click(function() {
        $(this).siblings().removeClass('active').end().addClass('active');

        $.ajaxSetup({
            async: false
        });
        var safeclass = $("#safeclass li").filter(".active").val();
        var deadline = $("#deadline li").filter(".active").val();
        var status = $("#status li").filter(".active").val();
        var url = "/Home/ProjectList?" + "safeclass=" + safeclass + "&deadline=" + deadline + "&status=" + status;
        window.location.href = url;

    });
</script>